package com.xbongbong.admin.domain.entity;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.xbongbong.paas.enums.DelEnum;
import com.xbongbong.paas.toolbox.util.DateTimeUtil;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 镜像阶段任务表
 * 
 * @author mingliang.cao
 * 
 * @date 2021-11-16
 */
@Getter
@Setter
@ToString
public class MirrorStageWorkEntity implements Serializable {
    private static final long serialVersionUID = -1830057832447230947L;
    /**
     * 主键
     */
    private Long id;

    /**
     * 镜像id
     */
    private Long mirrorId;

    /**
     * 镜像表单id
     */
    private Long mirrorFormId;

    /**
     * 镜像阶段流程id
     */
    private Long mirrorStageProcessId;

    /**
     * 镜像阶段id
     */
    private Long mirrorStageId;

    /**
     * 原表单Id
     */
    private Long sourceFormId;

    /**
     * 原阶段流程Id
     */
    private Long sourceStageProcessId;

    /**
     * 原阶段Id
     */
    private Long sourceStageId;

    /**
     * 原阶段工作Id
     */
    private Long sourceStageWorkId;

    /**
     * 镜像表单saas标识
     */
    @Deprecated
    private Integer mirrorSaasMark;

    /**
     * 镜像表单businessType
     */
    @Deprecated
    private Integer mirrorBusinessType;

    /**
     * 阶段code
     */
    private String stageCode;

    /**
     * 关联类型
     */
    private Integer businessType;

    /**
     * 区分SaaS业务还是PaaS业务（1SaaS、2PaaS）
     */
    private Integer saasMark;

    /**
     * 任务名称
     */
    private String name;

    /**
     * 任务描述
     */
    private String description;

    /**
     * 任务占比
     */
    private Integer proportion;

    /**
     * 任务是否必填（0不必填、1必填）
     */
    private Integer required;

    /**
     * 执行事件
     */
    private JSONObject executionEvent;

    /**
     * 执行人，空值代表所有人都允许执行
     */
    private JSONArray executor;

    /**
     * 任务完成条件
     */
    private JSONArray completionCondition;

    /**
     * 任务排序【sort值越大代表任务越靠前】
     */
    private Integer sort;

    /**
     * 创建人
     */
    @Deprecated
    private String creatorId;

    /**
     * 创建时间
     */
    private Long addTime;

    /**
     * 更新时间
     */
    private Long updateTime;

    /**
     * 删除标记
     */
    private Integer del;

    public MirrorStageWorkEntity() {
        del = 0;
    }

    public MirrorStageWorkEntity(Long mirrorId, Long mirrorFormId, Long mirrorStageProcessId, Long mirrorStageId, Long sourceFormId, Long sourceStageProcessId, Long sourceStageId, Long sourceStageWorkId, String stageCode, Integer businessType, Integer saasMark, String name, String description, Integer proportion, Integer required, JSONObject executionEvent, JSONArray executor, JSONArray completionCondition, Integer sort) {
        this.mirrorId = mirrorId;
        this.mirrorFormId = mirrorFormId;
        this.mirrorStageProcessId = mirrorStageProcessId;
        this.mirrorStageId = mirrorStageId;
        this.sourceFormId = sourceFormId;
        this.sourceStageProcessId = sourceStageProcessId;
        this.sourceStageId = sourceStageId;
        this.sourceStageWorkId = sourceStageWorkId;
        this.stageCode = stageCode;
        this.businessType = businessType;
        this.saasMark = saasMark;
        this.name = name;
        this.description = description;
        this.proportion = proportion;
        this.required = required;
        this.executionEvent = executionEvent;
        this.executor = executor;
        this.completionCondition = completionCondition;
        this.sort = sort;
        this.setUpdateTime(DateTimeUtil.getInt());
        this.setAddTime(DateTimeUtil.getInt());
        this.setDel(DelEnum.NORMAL.getDel());
    }
}